import request from '@/router/axios';

// 获取列表1
export const getFsTopicInfo = (current, size, params) => {
  return request({
    url: '/api/blade-purchase/ftopicinfo/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

// 获取列表2
export const getInquiryList = (createUser,current, size, params) => {
  return request({
    url: '/api/blade-purchase/ftopicinfo/inquiryList',
    method: 'get',
    params: {
      ...params,
      current,
      size,
      createUser
    }
  })
}

// 获取物料组
export const getMaterialGroupNoList = () => {
  return request({
    url: '/api/blade-purchase/materialgroupinfo/materialGroupNoList',
    method: 'get',
    params: {}
  })
}

// 专业组列表
export const getProGroupNoList = () => {
  return request({
    url: '/api/blade-purchase/materialgroupinfo/proGroupNoList',
    method: 'get'
  })
}

// 获取采购员
export const getBuyerByMaterialGroupNo = (mateiralGroupNo) => {
  return request({
    url: '/api/blade-purchase/basic/getBuyerByMaterialGroupNo',
    method: 'get',
    params: {
      mateiralGroupNo,
    }
  })
}

// 获取议题类型
export const getTopicTypeList = () => {
  return request({
    url: '/api/blade-purchase/topictype/topicTypeList',
    method: 'get'
  })
}
// 获取会议类型
export const getMeetingTypeList = () => {
  return request({
    url: '/api/blade-purchase/meetingtype/meetingTypeList',
    method: 'get'
  })
}
// 获取询价单详情
export const getInquiryDetail = (inquiryNo) => {
  return request({
    url: '/api/blade-purchase/ftopicinfo/inquiryDetail',
    method: 'get',
    params: {
      inquiryNo
    }
  })
}

// 根据物料组编号获取专业组
export const getProGroupByMaterialGroupNo = (materialGroupNo) => {
  return request({
    url: '/api/blade-purchase/materialgroupinfo/getProGroupByMaterialGroupNo',
    method: 'get',
    params: {
      materialGroupNo
    }
  })
}

// 保存
export const save = (data) => {
  return request({
    url: '/api/blade-purchase/ftopicinfo/save',
    method: 'post',
    data: data
  })
}

// 获取详情
export const getDetail = (id) => {
  return request({
    url: '/api/blade-purchase/ftopicinfo/detail',
    method: 'get',
    params: {
      id
    }
  })
}

// 获取会议列表
export const meetList = (params) => {
  return request({
    url: '/api/blade-purchase/ctopicinfo/ctopicList',
    method: 'get',
    params
  })
}
// 申报会议
export const reportMeeting = (ctopicNo,declareTopicType,ftopicNos) => {
  return request({
    url: '/api/blade-purchase/ftopicinfo/applyMeeting',
    method: 'post',
    data: {
      ctopicNo,
      declareTopicType,
      ftopicNos
    }
  })
}

// 删除
export const remove = (ids) => {
  return request({
    url: '/api/blade-purchase/ftopicinfo/remove',
    method: 'post',
    params: {
      ids
    }
  })
}

// 授权相关
export const getFSLeaderListFormPartGroupNo = (ftopicNo) => {
  return request({
    url: '/api/blade-purchase/ftopicinfo/authorzaUserList',
    method: 'get',
    params: {
      ftopicNo
    }
  })
}

export const savePerson = (data) => {
  return request({
    url: '/api/blade-purchase/ftopicinfo/authorizaFtopic',
    method: 'post',
    data
  })
}

export const personelDel = (id) => {
  return request({
    url: '/api/blade-purchase/ftopicinfo/removeAuthorzaUser',
    method: 'get',
    params: {
      id
    }
  })
}
// 同步
export const sycnData = (ctopicNo,ftopicNo,materialId) => {
  return request({
    url: '/api/blade-purchase/ftopicinfo/synchronize',
    method: 'post',
    data: {
      ctopicNo,
      ftopicNo,
      materialId
    }
  })
}

// 上会历程
export const meetingHistory = (ftopicNo) => {
  return request({
    url: '/api/blade-purchase/ftopicinfo/meetingHistory',
    method: 'get',
    params: {
      ftopicNo
    }
  })
}

// 附件详情
export const getFileList = (displayType,ctopicNo,ftopicNo) => {
  return request({
    url: '/api/blade-purchase/displaymaterial/displayMaterialAttachDetail',
    method: 'get',
    params: {
      ctopicNo,
      ftopicNo,
      displayType
    }
  })
}
